package edu.pku.sei.transformation.editor.views.figures;

import org.eclipse.draw2d.Connection;
import org.eclipse.draw2d.geometry.Point;

import edu.pku.sei.modeler.edit.parts.ConnectionMidPointLocator;

public class MidPointLocator extends ConnectionMidPointLocator {

	Point offset;

	public MidPointLocator(Connection c, Point offset) {
		super(c);
		this.offset = offset;
	}

	@Override
	protected Point getReferencePoint() {
		if (this.offset != null) {
			Point p = super.getReferencePoint();
			p.translate(offset);
			return p;
		} else {
			return super.getReferencePoint();
		}
	}
}
